<template>
  <div
    class="common-page page-phone"
    v-loading.fullscreen="loading"
  >
    <div class="common-page__body page-phone__body">
      <table class="phone-table">
        <thead>
          <tr>
            <th>地市</th>
            <th>广西实体经济服务员工作队驻市工作队热线电话</th>
            <th>各市壮大实体经济推动高质量发展调研服务工作专班热线电话</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>南宁市</td>
            <td>0771-5530623</td>
            <td>0771-5530506</td>
          </tr>
          <tr>
            <td>柳州市</td>
            <td>0772-2861105</td>
            <td>0772-2820317</td>
          </tr>
          <tr>
            <td>桂林市</td>
            <td>0773-3696983</td>
            <td>0773-3676560</td>
          </tr>
          <tr>
            <td>梧州市</td>
            <td>0774-3814197</td>
            <td>0774-3818391</td>
          </tr>
          <tr>
            <td>北海市</td>
            <td>0779-2029728</td>
            <td>0779-2029728</td>
          </tr>
          <tr>
            <td>钦州市</td>
            <td>0777-3685165</td>
            <td>0777-3688602</td>
          </tr>
          <tr>
            <td>防城港市</td>
            <td>0770-2816588</td>
            <td>0770-2816588</td>
          </tr>
          <tr>
            <td>贵港市</td>
            <td>0775-4229923</td>
            <td>0775-4229904</td>
          </tr>
          <tr>
            <td>玉林市</td>
            <td>0775-2865065</td>
            <td>0775-2837655</td>
          </tr>
          <tr>
            <td>百色市</td>
            <td>0776-2868862</td>
            <td>0776-2620158</td>
          </tr>
          <tr>
            <td>贺州市</td>
            <td>18978337677</td>
            <td>18907848688</td>
          </tr>
          <tr>
            <td>河池市</td>
            <td>15177775604</td>
            <td>0778-3882020</td>
          </tr>
          <tr>
            <td>来宾市</td>
            <td>0772-4299656</td>
            <td>0772-4299161</td>
          </tr>
          <tr>
            <td>崇左市</td>
            <td>19978166866</td>
            <td>0771-7968853</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
import mixin from "../mixin";
import { string, int } from "../util";
export default {
  name: "page-phone",
  title: "专班热线",
  nodes: ["/menu/phone"],
  childs: [],
  mixins: [mixin],
  data: () => ({
    loading: false,
  }),
  methods: {
    destroy() {
                if (this.loading) return;
                return true;
            },
            init() {
                if (this.loading) return;
                this.loading = true;
                this.$root.$refs.navbar.init();
                this.plugins.user.call(async () => {
                    let res = await this.plugins.user.init();
                    if (res.code === 0) { }
                    return res;
                }).then((res) => {
                    this.loading = false;
                    this.$root.$refs.navbar.init();
                    if (res.code === 0) {
                        if (this.access(this.$route.name)) {
                            let name = this.$options.childs.find((name) => this.access(name));
                            if (name) this.$router.replace(name);
                        } else {
                            this.$router.replace("/home");
                        }
                    } else if (res.code === 2) {
                        this.$root.$refs.navbar.login();
                    } else {
                        this.plugins.modal.alert("页面加载失败", res.code + "：" + res.msg, "error").then(() => this.$router.replace("/home"));
                    }
                });
            },
  },
};
</script>

<style lang="scss">
.page-phone {
  overflow: hidden;
}

.page-phone__body {

  .phone-table {
    width: 90%;
    max-width: 1200px;
    border-collapse: collapse;
    margin: 20px 0;

    th,
    td {
      padding: 12px 15px;
      text-align: center;
      border-bottom: 1px solid #ddd;
    }

    th {
      background-color: #f5f5f5;
      font-weight: bold;
      color: #333;
    }

    tr:hover {
      background-color: #f9f9f9;
    }

    tbody tr:nth-child(even) {
      background-color: #f1f1f1;
    }
  }
}
</style>